package memory

import (
	log "github.com/sirupsen/logrus"
)

//设置自身数据
func (cache *Memorystore) AssignThis(data interface{}) {
	cache.Mutex.Lock()
	defer cache.Mutex.Unlock()
	//判断data是否是字符串类型
	if val, ok := data.(map[string]interface{}); ok {
		cache.Datas = val
	} else {
		log.Warn("反序列化数据异常.")
	}
}
